package com.longge;

/**
 * @创建人 xinglongge
 * @创建时间 2021/11/25
 * @描述
 */
public class ReverseList {
    public ListNode reverseList(ListNode head) {
        if (head == null || head.next == null) return head;
        ListNode lastNode = reverseList(head.next);
        head.next.next = head;
        head.next = null;
        return lastNode;
    }
}
